package com.luckberry.murder.service.impl;

import com.luckberry.murder.entity.House;
import com.luckberry.murder.mapper.HouseMapper;
import com.luckberry.murder.service.HouseService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class HouseServiceImpl implements HouseService {

    @Resource
    private HouseMapper mapper;

    @Override
    public List<House> getHouses() {
        return mapper.getHouses();
    }

    @Override
    public List<House> getHousesByState(String state) {
        return mapper.getHousesByState(state);
    }

    @Override
    public List<House> getHousesByScript(int sid) {
        return mapper.getHousesByScript(sid);
    }

    @Override
    public House getHouse(int hid) {
        return mapper.getHouse(hid);
    }

    @Override
    public boolean addHouse(House house) {
        return mapper.addHouse(house) == 1;
    }

    @Override
    public boolean deleteHouse(int hid) {
        return mapper.deleteHouse(hid) == 1;
    }

    @Override
    public boolean editHouse(House house) {
        return mapper.editHouse(house) == 1;
    }
}
